import Toast from './Toast' 

const obj = {}

obj.install = function (Vue) {
 
  //创建组件构造器
  const toastContrustor = Vue.extend(Toast)
  //根据组件构造器创建一个组件对象
  const toast = new toastContrustor()
  //将组件对象手动挂载某个元素上
  toast.$mount(document.createElement('div'))
  //获取div $el就是指div
  document.body.appendChild(toast.$el)
  Vue.prototype.$toast = toast
}

export default obj